import { formatTime } from '@/utils'
import i18n from '@/locales/index' 
const { t } = i18n.global

export const routeRule = {
  // name: [
  //   { required: true, message: '$t('common.pleaseInput')版本名称', trigger: 'change' }
  // ],
  section: [
    { required: true, message: t('basicData.pleaseSelectSection'), trigger: 'change' }
  ]
}

export const routeHeader = [t('hangManage.stationSequence'), t('hangManage.effectMainStation'), t('hangManage.mergeScale'), t('hangManage.processInfoStationInfo'),t('basicData.staffInfo') , t('common.operate')]
// export const viewRouteHeader = ['顺序/站号', '生效/主站', '合并/比例', '工序信息/站号信息' ]
// export const routeHeaderWeb = ['顺序/站号', '生效/主站', '合并/比例', '工序信息/站号信息','员工信息', '操作']
// export const viewRouteHeaderWeb = ['顺序/站号', '生效/主站', '合并/比例', '工序信息/站号信息','员工信息']
export const processHeader = [t('common.sequenceNo'), t('basicData.section'), t('basicData.processNo'), t('basicData.processNames')]
export const siteHeader = [t('common.sequenceNo'), t('deviceManage.waterLineNo'), t('hangManage.stationNo'), t('deviceManage.role')]
export const stationTypeList = [{ name: t('other.normal'), value: '0' }, { name: t('other.save'), value: '1' } , { name: t('other.rework'), value: '2' }]

export const stationRule = {
  role: [{
    required: true,
    trigger: 'change',
  }],
  receiveHangerBoolean: [{
    required: true,
    trigger: 'change',
  }],
  proportion: [{
    required: true,
    trigger: 'change',
  }],
  type: [{
    required: true,
    trigger: 'change',
  }]
}

export const listOutColumns =  [
  {
    title: t('common.sequenceNo'), dataIndex: 'index', key: 'index', align: 'center', width: 80,
    customRender: ({ index }) => {
      return index + 1
    }
  },
  { title: t('hangManage.makeNo'), dataIndex: 'moNo', key: 'moNo', align: 'center', width: 130 },
  { title: t('basicData.styleNo'), dataIndex: 'styleNo', key: 'styleNo', align: 'center', width: 130 },
  { title: t('basicData.styleNa'), dataIndex: 'styleName', key: 'contactPerson', align: 'center', width: 130 },
  { title: t('common.verNumber'), dataIndex: 'versionNo', key: 'versionNo', align: 'center', width: 100 },
  {
    title: t('common.createTime'), dataIndex: 'createTime', key: 'createTime', align: 'center', width: 170,
    customRender: ({ text }) => {
      return formatTime(text, 'YYYY-MM-DD HH:mm:ss')
    }
  },
  {
    title: t('common.lastEditTime'), dataIndex: 'updateTime', key: 'updateTime', align: 'center', width: 170,
    customRender: ({ text }) => {
      return formatTime(text, 'YYYY-MM-DD HH:mm:ss')
    }
  },
  { title: t('common.state'), dataIndex: 'status', key: 'status', align: 'center', width: 130 }, 
  { title: t('common.operate'), dataIndex: 'operate', key: 'operate', align: 'center', width: 130, fixed: 'right' },
] 
export const copyColumns =  [
  {
    title: t('common.sequenceNo'), dataIndex: 'index', key: 'index', align: 'center', width: 60,
    customRender: ({ index }) => {
      return index + 1
    }
  },
  { title: t('hangManage.makeNo'), dataIndex: 'moNo', key: 'moNo', align: 'center'},
  { title: t('basicData.styleNo'), dataIndex: 'styleNo', key: 'styleNo', align: 'center'},
  { title: t('basicData.styleNa'), dataIndex: 'style', key: 'style', align: 'center' },
  { title: t('basicData.productType'), dataIndex: 'productType', key: 'productType', align: 'center' },
]

export const queryStatusOptions = [
  { value: 0, key: t('other.unProduction') },
  { value: 1, key: t('other.inProduct') },
  { value: 2, key: t('sysManage.completed') },
]